package extend.java.stream;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.UUID;
import java.util.stream.Collectors;

import org.junit.Before;
import org.junit.Test;

public class test {
	private ArrayList<Integer> list;

	@Before
	public void prepareNum() {
		list = new ArrayList<Integer>();
		for (int i = 0; i < 10; i++) {
			int int1 = new Random().nextInt(100);
			list.add(int1);
		}

	}

	@Test
	public void maxNum() {

		/*
		 * for (Iterator<Integer> it = list.iterator(); it.hasNext();) { if
		 * (it.next() < 50) { it.remove(); } } for (Integer integer : list) {
		 * System.out.print(integer + " "); }
		 */
		UUID uuid = UUID.randomUUID();
		System.out.println(uuid.toString());
		List<Integer> list2 = list.stream().filter(x -> x > 50)
				.collect(Collectors.toList());
		for (Integer integer : list2) {
			System.out.print(integer + " ");
		}
	

	}

}
